<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title><s:text name="login.title" /></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	<script type="text/javascript">   
	    function changeValidateCode(obj) {   
	           //获取当前的时间作为参数，无具体意义   
	        var timenow = new Date().getTime();   
	           //每次请求需要一个不同的参数，否则可能会返回同样的验证码   
	        //这和浏览器的缓存机制有关系，也可以把页面设置为不缓存，这样就不用这个参数了。   
	        obj.src="<%=request.getContextPath() %>/action/rand.do?d="+timenow;   
	    }   
	</script>
	
  </head>
  
  <body>
    <form action="login.do" name="login" method="post" >
    	username：<input type="text"  name="username" size="30"><br>
    	password：<input type="password" name="password" size="30"><br>
    	age：<input type="text"  name="age" size="30"><br>
    	random：<input  type="text" name="rand" size="5"><img src="<%=request.getContextPath() %>/action/rand.do" onclick="changeValidateCode(this)" title="点击图片刷新验证码"/><br>
    	<input type="submit" value="提交"/>"
    </form>
  </body>
</html>
